/**
 * Sample React Native App
 * https://github.com/facebook/react-native
 * @flow
 */

import React, { Component } from 'react';
import {
  View
} from 'react-native';
//导入首页
import {CreateHomeStackNavigate} from './CreateHomeStackNavigate';
//导入精品页面
import {CreateListStackNavigate} from './CreateListStackNavigate';
//导入我的页面
import {CreateMyStackNavigate} from './CreateMyStackNavigate';
export const createTabScreen = (name,screens,tintColor = '#673ab7') => {
  class TabScreen extends Component {
    static navigationOptions = ({navigation})=>{
      //const params = navigation.state.params || {};
      return {

        tabBarLabel: name,
        labelStyle:{
           fontSize:14,
           color:tintColor
        }
        //headerTitle:params.title?params.title:'柠檬邦'
      }
    };
    _screen(){
      switch(screens){
        //首页底部导航
        case 'Home':
          nodes = <CreateHomeStackNavigate />;
        break;
        //列表页底部导航
        case 'List':
          nodes = <CreateListStackNavigate />;
          //nodes = focused?require('../assets/images/icon-cancel-active.png'):require('../assets/images/icon-cancel.png');
        break;
        //创客中心
        case 'Commission':
          nodes = <CreateHomeStackNavigate />;
        break;
        //购物车
        case 'Cart':
          nodes = <CreateHomeStackNavigate />;
        break;
        case 'User':
          nodes = <CreateMyStackNavigate />;
        break;
      }
      return  nodes;
    }
    render() {
      return this._screen();
    }
  }
  return TabScreen;
}
